#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
using namespace std;

class Solution {
public:
    int singleNumber(vector<int>& nums)
    {
        map<int, int> hash;
        for (auto e : nums)
        {
            hash[e]++;
        }
        int ans;
        for (auto kv : hash)
        {
            if (kv.second == 1)
            {
                ans = kv.first;
                break;
            }
        }
        return ans;
    }
};

